Method for wireless fidelity connection and related products

ABSTRACT

A method for Wi-Fi connection and related products are provided. The method includes the following. A first password input in response to user operation is obtained, where the first password is used for connecting to a target AP. In response to an unsuccessful verification of the first password, according to property information of the target AP, N target Wi-Fi connection records corresponding to the target AP are obtained from historical Wi-Fi connection data, where the historical Wi-Fi connection data contains M Wi-Fi connection records, M is a positive integer, and N is a positive integer smaller than or equal to M. Connect to the target AP according to the N target Wi-Fi connection records.

CROSS-REFERENCE TO RELATED APPLICATION(S)

This application is a continuation of International Application No.PCT/CN2017/103186, filed on Sep. 25, 2017, which claims priority toChinese Patent Application No. 201710091627.6, filed on Feb. 20, 2017,both of which are incorporated herein by reference in their entireties.

TECHNICAL FIELD

The present disclosure relates to the technical field of communications,and particularly to a method for wireless fidelity (Wi-Fi®) connectionand related products.

BACKGROUND

With rapid development of information technologies, terminals such asmobile phones and tablet computers become increasingly popular. Userrequirements on the terminals also become increasingly high. There isnot only a need for a relatively high processing speed, but also anincreasing dependence on Wi-Fi. With popularization of the terminals andWi-Fi, it is frequent to connect the terminals to a Wi-Fi network.

Generally, only when a service set identifier (SSID), an encryptionscheme, and a password are all matched, the terminals can be normallyconnected to an access point (AP).

SUMMARY

Implementations of the present disclosure provide a method for Wi-Ficonnection and related products.

According to a first aspect of the present disclosure, a method forWi-Fi connection is provided. The method includes the following. Aninput password used for connecting a terminal to a target AP isobtained. In response to an unsuccessful verification of the inputpassword, according to property information of the target AP, N targetWi-Fi connection records corresponding to the target AP are obtainedfrom historical Wi-Fi connection data, where the historical Wi-Ficonnection data contains M Wi-Fi connection records, M is a positiveinteger, and N is a positive integer smaller than or equal to M. Theterminal is connected to the target AP according to the N target Wi-Ficonnection records.

According to a second aspect of the present disclosure, a terminal isprovided. The terminal includes at least one processor, and a computerreadable memory, coupled to the at least one processor and storing atleast one computer executable instruction therein, which when executedby the at least one processor, causes the at least one processor tocarry out the following actions. An input password used for connectingthe terminal to a target AP is obtained. In response to an unsuccessfulverification of the input password, according to property information ofthe target AP, N target Wi-Fi connection records corresponding to thetarget AP are obtained from historical Wi-Fi connection data, where thehistorical Wi-Fi connection data contains M Wi-Fi connection records, Mis a positive integer, and N is a positive integer smaller than or equalto M. The terminal is connected to the target AP according to the Ntarget Wi-Fi connection records.

According to a third aspect of the present disclosure, a terminal isprovided. The terminal includes at least one processor, and a computerreadable memory, coupled to the at least one processor and storing atleast one computer executable instruction therein, which when executedby the at least one processor, causes the at least one processor tocarry out the following actions. In response to an unsuccessfulconnection to an AP according to an input password, at least onepassword is determined from historical Wi-Fi connection data pre-storedin the terminal, where the at least one password was previously used forconnecting the terminal to the AP. The terminal is connected to the APaccording to the at least one password.

BRIEF DESCRIPTION OF THE DRAWINGS

To describe technical solutions in implementations of the presentdisclosure more clearly, the following briefly introduces theaccompanying drawings required for describing the implementations.Apparently, the accompanying drawings in the following descriptionillustrate some implementations of the present disclosure. Those ofordinary skill in the art may also obtain other drawings based on theseaccompanying drawings without creative efforts.

FIG. 1 is a flow chart illustrating a method for Wi-Fi connectionaccording to a first implementation of the present disclosure.

FIG. 2 is a flow chart illustrating a method for Wi-Fi connectionaccording to a second implementation of the present disclosure.

FIG. 3 is a block diagram illustrating an apparatus for Wi-Fi connectionaccording to an implementation of the present disclosure.

FIG. 4 is a block diagram illustrating a second obtaining unit of theapparatus for Wi-Fi connection illustrated in FIG. 3 according to animplementation of the present disclosure.

FIG. 5 is another block diagram illustrating the second obtaining unitof the apparatus for Wi-Fi connection illustrated in FIG. 3 according toan implementation of the present disclosure.

FIG. 6 is a block diagram illustrating a connecting unit of theapparatus for Wi-Fi connection illustrated in FIG. 3 according to animplementation of the present disclosure.

FIG. 7 is a block diagram illustrating a first connecting module of theconnecting unit illustrated in FIG. 6 according to an implementation ofthe present disclosure.

FIG. 8 is a block diagram illustrating a terminal according to animplementation of the present disclosure.

DETAILED DESCRIPTION

In related arts, it may take some time for a user to know a password ofan AP when going to a place. However, due to some error operations orthat a terminal only records a limited number of APs, some AP recordsmay be cleared during usage. Therefore, a password needs to be inputonce again to be connected the terminal to an AP previously connected.If several error passwords are input, an efficiency of Wi-Fi connectionis accordingly reduced. Therefore, implementations of the presentdisclosure provide a method for Wi-Fi connection and related products,so as to improve the efficiency of Wi-Fi connection.

Technical solutions of the present disclosure will be further describedbelow through implementations with reference to the accompanyingdrawings. Apparently, the described implementations are merely some ofrather than all implementations of the present disclosure. All otherimplementations obtained by those of ordinary skill in the art based onthe implementations of the present disclosure without creative effortsshall fall within the protection scope of the present disclosure.

The terms “first”, “second”, “third”, “fourth”, and the like used in thespecification, the claims, and the accompany drawings of the presentdisclosure are used to distinguish different objects rather thandescribe a particular order. Further, the terms “include”, “comprise”,and “have” as well as variations thereof are intended to covernon-exclusive inclusion. For example, a process, method, system,product, or apparatus including a series of steps or units is notlimited to the listed steps or units; on the contrary, it can optionallyinclude other steps or units that are not listed; alternatively, othersteps or units inherent to the process, method, product, or device canbe included either.

“Implementation” mentioned in the disclosure means that specificcharacteristics, structures, or properties described in connection withan implementation may be included in at least one implementation of thedisclosure. This word appears at each position in the specification doesnot refer to the same implementation as well as an independent oralternate implementation mutually exclusive to other implementations. Itmay be explicitly and implicitly understood by those skilled in the artthat the implementations described in the disclosure may be combinedwith the other implementations.

A terminal described in the implementations of the present disclosuremay include a smart phone (such as an Android® phone, an iOS® phone, anda Windows® phone), a tablet computer, a palmtop computer, a notebookcomputer, a mobile Internet device (MID), wearable equipment, or thelike, which are not exhausted but only listed as examples. The terminalincludes, but is not limited to, the listed terminals.

Historical Wi-Fi connection data in the implementations of the presentdisclosure may contain multiple Wi-Fi connection records. Each Wi-Ficonnection record may contain an AP previously connected (a terminal waspreviously connected to the AP), i.e., each Wi-Fi connection recordcontains property information of an AP, where the property informationmay include at least one of an SSID, a basic service set identifier(BSSID), an encryption scheme, a password, and so on. Certainly, eachtime the terminal is connected to an AP, a Wi-Fi connection record canbe generated to record an SSID, a BSSID, an encryption scheme, and apassword of the AP.

According to a first aspect of the present disclosure, a method forWi-Fi connection is provided. The method includes the following. Aninput password used for connecting a terminal to a target AP isobtained. In response to an unsuccessful verification of the inputpassword, according to property information of the target AP, N targetWi-Fi connection records corresponding to the target AP are obtainedfrom historical Wi-Fi connection data, where the historical Wi-Ficonnection data contains M Wi-Fi connection records, M is a positiveinteger, and N is a positive integer smaller than or equal to M. Theterminal is connected to the target AP according to the N target Wi-Ficonnection records.

In at least one implementation, according to the property information ofthe target AP, the N target Wi-Fi connection records corresponding tothe target AP are obtained from the historical Wi-Fi connection data asfollows. An SSID and an encryption scheme of the target AP are obtained.According to the SSID and the encryption scheme of the target AP, the Ntarget Wi-Fi connection records are determined from the historical Wi-Ficonnection data.

In at least one alternative implementation, according to the propertyinformation of the target AP, the N target Wi-Fi connection recordscorresponding to the target AP are obtained from the historical Wi-Ficonnection data as follows. A BSSID of the target AP is obtained. The Ntarget Wi-Fi connection records are determined from the historical Wi-Ficonnection data, where each of the N target Wi-Fi connection recordscontains the BSSID.

In at least one alternative implementation, according to the propertyinformation of the target AP, the N target Wi-Fi connection recordscorresponding to the target AP are obtained from the historical Wi-Ficonnection data as follows. An encryption scheme of the target AP isobtained. According to the encryption scheme of the target AP, the Ntarget Wi-Fi connection records are determined from the historical Wi-Ficonnection data.

In at least one alternative implementation, according to the propertyinformation of the target AP, the N target Wi-Fi connection recordscorresponding to the target AP are obtained from the historical Wi-Ficonnection data as follows. An SSID of the target AP is obtained.According to the SSID of the target AP, the N target Wi-Fi connectionrecords are determined from the historical Wi-Fi connection data.

In at least one implementation, the terminal is connected to the targetAP according to the N target Wi-Fi connection records as follows. The Ntarget Wi-Fi connection records are saved to a predetermined list. Fromthe predetermined list, K passwords corresponding to the N target Wi-Ficonnection records are obtained, where K is an integer smaller than orequal to N. The terminal is connected to the target AP according to theK passwords.

In at least one implementation, the terminal is connected to the targetAP according to the K passwords as follows. An occurrence frequency ofeach of the K passwords in the predetermined list to obtain Kfrequencies is determined. A priority sequence of the K passwords isdetermined according to the K frequencies. According to the prioritysequence, a password is selected from the K passwords. The terminal isconnected to the target AP according to the password selected, an SSIDand an encryption scheme of the target AP.

In at least one implementation, the method further includes thefollowing. A ratio of the number of occurrence times of each of the Kpasswords in the predetermined list to N is determined as the occurrencefrequency of each of the K passwords in the predetermined list.

In at least one implementation, the input password includes at least oneof a character string, fingerprint information, voice information, andiris information.

According to a second aspect of the present disclosure, a terminal isprovided. The terminal includes at least one processor, and a computerreadable memory, coupled to the at least one processor and storing atleast one computer executable instruction therein, which when executedby the at least one processor, causes the at least one processor tocarry out the following actions. An input password used for connectingthe terminal to a target AP is obtained. In response to an unsuccessfulverification of the input password, according to property information ofthe target AP, N target Wi-Fi connection records corresponding to thetarget AP are obtained from historical Wi-Fi connection data, where thehistorical Wi-Fi connection data contains M Wi-Fi connection records, Mis a positive integer, and N is a positive integer smaller than or equalto M. The terminal is connected to the target AP according to the Ntarget Wi-Fi connection records.

According to a third aspect of the present disclosure, a terminal isprovided. The terminal includes at least one processor, and a computerreadable memory, coupled to the at least one processor and storing atleast one computer executable instruction therein, which when executedby the at least one processor, causes the at least one processor tocarry out the following actions. In response to an unsuccessfulconnection to an AP according to an input password, at least onepassword is determined from historical Wi-Fi connection data pre-storedin the terminal, where the at least one password was previously used forconnecting the terminal to the AP. The terminal is connected to the APaccording to the at least one password.

Referring to FIG. 1, FIG. 1 is a flow chart illustrating a method forWi-Fi connection according to a first implementation of the presentdisclosure. The method for Wi-Fi connection illustrated in theimplementation includes the following.

At block 101, a first password input in response to user operation isobtained, where the first password is used for connecting a terminal toa target AP.

The first password may be at least one of a character string,fingerprint information, voice information, iris information, and so on.The terminal can display a Wi-Fi list on a display screen of theterminal. The Wi-Fi list may contain information of multiple APs. Thetarget AP can be selected. The first password of the target AP can beinput in response to user operation.

At block 102, in response to an unsuccessful verification of the firstpassword, N target Wi-Fi connection records corresponding to the targetAP are obtained from historical Wi-Fi connection data according to theproperty information of the target AP, where the historical Wi-Ficonnection data contains M Wi-Fi connection records, M is a positiveinteger, and N is a positive integer smaller than or equal to M.

The terminal can verify the first password. In response to a successfulverification of the first password, the terminal can be connected to thetarget AP. In response to the unsuccessful verification of the firstpassword, according to the property information of the target AP, the Ntarget Wi-Fi connection records corresponding to the target AP can beobtained from the historical Wi-Fi connection data.

In an implementation, at block 102, according to the propertyinformation of the target AP, the N target Wi-Fi connection recordscorresponding to the target AP can be obtained from the historical Wi-Ficonnection data as follows.

An SSID of the target AP is obtained. According to the SSID of thetarget AP, the N target Wi-Fi connection records are determined from thehistorical Wi-Fi connection data.

According to an SSID of the target AP, the N target Wi-Fi connectionrecords corresponding to the target AP can be determined from thehistorical Wi-Fi connection data.

In an implementation, at block 102, according to the propertyinformation of the target AP, the N target Wi-Fi connection recordscorresponding to the target AP can be obtained from the historical Wi-Ficonnection data as follows.

An encryption scheme of the target AP is obtained. According to theencryption scheme of the target AP, the N target Wi-Fi connectionrecords are determined from the historical Wi-Fi connection data.

According to the encryption scheme of the target AP, the N target Wi-Ficonnection records corresponding to the target AP can be determined fromthe historical Wi-Fi connection data.

In an implementation, at block 102, according to the propertyinformation of the target AP, the N target Wi-Fi connection recordscorresponding to the target AP can be obtained from the historical Wi-Ficonnection data as follows.

21) The SSID and the encryption scheme of the target AP are obtained.

22) According to the SSID and the encryption scheme of the target AP,the N target Wi-Fi connection records are determined from the historicalWi-Fi connection data.

According to the SSID and the encryption scheme of the target AP, the Ntarget Wi-Fi connection records corresponding to the target AP can bedetermined from the historical Wi-Fi connection data. Each AP has acorresponding SSID and encryption scheme. Therefore, according to theSSID and the encryption scheme of the target AP, the N target Wi-Ficonnection records corresponding to the target AP can be determined fromthe historical Wi-Fi connection data.

In an implementation, at block 102, according to the propertyinformation of the target AP, the N target Wi-Fi connection recordscorresponding to the target AP can be obtained from the historical Wi-Ficonnection data as follows.

23) A BSSID of the target AP is obtained.

24) According to the BSSID of the target AP, the N target Wi-Ficonnection records are determined from the historical Wi-Fi connectiondata, where each of the N target Wi-Fi connection contains the BSSID.

The BSSID of the target AP can be obtained. From the historical Wi-Ficonnection data, Wi-Fi connection records each containing the BSSID canbe found. For example, the N Wi-Fi connection records can be obtained.Since a BSSID of an AP is generally fixed, the AP can be identified bythe BSSID. Accordingly, Wi-Fi connection records of the AP correspondingto the BSSID can be accurately obtained from the historical Wi-Ficonnection data.

At block 103, the terminal is connected to the target AP according tothe N target Wi-Fi connection records.

The N target Wi-Fi connection records contain N passwords, and thus theterminal can be connected to the target AP according to the N passwords.If the password of the target AP is one of the N passwords, the terminalcan be connected to the target AP after N attempts.

In an implementation, at block 103, according to the N target Wi-Ficonnection records, the terminal is connected to the target AP asfollows.

31) The N target Wi-Fi connection records are saved to a predeterminedlist.

32) From the predetermined list, K passwords corresponding to the Ntarget Wi-Fi connection records are obtained, where K is an integersmaller than or equal to N.

33) The terminal is connected to the target AP according to the Kpasswords.

The terminal can save the N target Wi-Fi connection records to thepredetermined list. The predetermined list can be set by the user, forexample, items in the predetermined list can be set by the user. Thepredetermined list may contain multiple records, where each recordcontains an SSID, a BSSID, an encryption scheme, and a password. Asillustrated in table 1, an example of the predetermined list isillustrated. Certainly, the predetermined list can be displayed on adisplay screen of the terminal. Passwords can be extracted from thepredetermined list. Since among the N target Wi-Fi connection records,two or more Wi-Fi connection records may have the same password, the Kpasswords can be obtained, where K is an integer smaller than or equalto N. The terminal then attempts to be connected to the target APaccording to the K passwords. For example, if K is 3, and the threepasswords are abcded, 112239, and xxx123, respectively, abcded can befirst used as a password for connecting to the target AP. If it fails,112239 can be used as a password for connecting to the target AP. If itfails, xxx123 can then be used as a password for connecting to thetarget AP.

TABLE 1 AP SSID BSSID Encryption scheme Password 1 Cathay A1 WPA_PSK888888 2 118 B1 WPA_PSK Admini 3 China-net C1 WPA_PSK 1 + 1 = 2

In the implementation of the present disclosure, the method may beapplied to an application scenario illustrated as follows. For example,an SSID, an encryption scheme, and a password are input in response touser operation to add a hidden AP. Whether saved AP configurationcontains an SSID and an encryption respectively the same as the inputSSID and the input encryption scheme can be detected. If the SSID andthe encryption of one AP are the same as the input SSID and the inputencryption scheme, respectively, before overriding the configuration ofthe AP, a password of the AP is backed up. If an error password is inputfor connection, a prompt of error password is output. If an errorpassword is input, the configuration of the AP to be added is modified,and the password of the AP is changed to the backup password. In thiscase, it can be ensured that the terminal can also be connected to therecorded AP, avoiding the problem of error password. For example, thesaved configuration of one AP is the following: an SSID is TEST, anencryption scheme is WAP_PSK, and a password is 12345678; theconfiguration of the hidden AP to be added is the following: an SSID isTEST, an encryption scheme is WAP_PSK, and a password is 00000000.During adding the AP, the password of the TEST is changed to 00000000,which results in that the terminal cannot be normally connected to therecorded AP. By means of the implementation of the present disclosure,if adding the hidden AP fails, one AP having the same SSID andencryption scheme as the AP to be connected to at current time can befound from the historical Wi-Fi connection data, and the password isrecovered to 12345678, and thus the terminal can be normally connectedto the recorded AP.

For another example, each time the terminal is connected to an AP, anSSID, an encryption scheme, and a password of the AP can be recorded toform a Wi-Fi connection record corresponding to the AP, and the Wi-Ficonnection record is saved to a file. The file may be similar to a filerecording AP information in the related art. However, the file justrecords property information of all APs previously connected. If aninput password for connecting to an AP is error, after Wi-Fi scan, aWi-Fi list can be obtained, and thus the terminal can easily obtain anSSID and an encryption scheme of the AP to which the terminal needs tobe connected at current time. From the historical Wi-Fi connection data,one or more APs having the same SSID and AP as the AP to which theterminal needs to be connected at current time are found, and one ormore matched Wi-Fi connection records are saved to the predeterminedlist. If the predetermined list L just contains one Wi-Fi connectionrecord, the password of the matched AP is used for connection. If thepredetermined list contains multiple Wi-Fi connection records, thepasswords of the APs are traversed for connection. Thus, a probabilityof connecting to an AP is improved.

For yet another example, after Wi-Fi scan, a Wi-Fi list can be obtained.According to information of APs currently scanned, it is easy to obtaina BSSID of an AP to which the terminal is to be connected at currenttime, and then the historical Wi-Fi connection data is searched to findwhether there are one or more APs each having the BSSID as an MACaddress. If one or more APs are found, the one or more APs are recordedin the predetermined list. If the predetermined list just contains oneAP, the password of the matched AP is used for connection. If thepredetermined list contains multiple APs, the passwords of the APs aretraversed for connection (In principle a MAC address of a device isunique, excluding change in response to user operation). Thus, aprobability of connecting to an AP is improved.

For yet another example, the target AP may be an AP previously connectedby the terminal. Initially, a password of the AP is A, and then thepassword of the AP is changed to B from A. Generally, after the passwordis changed to A from B, the terminal still performs Wi-Fi connection byusing B, and thus the terminal cannot be connected to the target AP. Bymeans of the implementation of the present disclosure, after anunsuccessful verification of the password, the password previously usedfor connecting to the target AP can be found from the historical Wi-Ficonnection data, and thus the terminal can be connected to the targetAP. Certainly, if the terminal was connected to the target AP, theterminal can attempt to be connected to the target AP by using thepassword previously used for connecting to the target AP.

It can be seen that, by means of the implementation of the presentdisclosure, the first password input in response to user operation isobtained, where the first password is used for connecting to the targetAP. In response to the unsuccessful verification of the first password,according to the property information of the target AP, the N targetWi-Fi connection records corresponding to the target APs are obtainedfrom the historical Wi-Fi connection data, where the historical Wi-Ficonnection data contains M Wi-Fi connection records, M is a positiveinteger, and N is a positive integer smaller than or equal to M. Theterminal is connected to the target AP according to the N target Wi-Ficonnection records. In this case, the terminal can be connected to thetarget AP by using the password in the historical Wi-Fi connection dataand corresponding to the target AP. Thus, an efficiency of Wi-Ficonnection is improved.

In consistence with the above, referring to FIG. 2, FIG. 2 is a flowchart illustrating a method for Wi-Fi connection according to a secondimplementation of the present disclosure. The method for Wi-Ficonnection illustrated in the implementation includes the following.

At block 201, a first password input in response to user operation isobtained, where the first password is used for connecting a terminal toa target AP.

At block 202, in response to an unsuccessful verification of the firstpassword, according to property information of the target AP, N targetWi-Fi connection records corresponding to the target AP are obtainedfrom the historical Wi-Fi connection data, where the historical Wi-Ficonnection data contains M Wi-Fi connection records, M is a positiveinteger, and N is a positive integer smaller than or equal to M.

At block 203, the N target Wi-Fi connection records are saved to apredetermined list.

At block 204, K passwords corresponding to the N target Wi-Fi connectionrecords are obtained from the predetermined list, where K is an integersmaller than or equal to N.

The terminal can save the N target Wi-Fi connection records to thepredetermined list. The predetermined list can be set by the user, forexample, items in the predetermined list can be set by the user.Certainly, the predetermined list can be displayed on a display screenof the terminal. Passwords can be extracted from the predetermined list.Since among the N target Wi-Fi connection records, two or more Wi-Ficonnection records may have the same password, the K passwords can beobtained, where K is an integer smaller than or equal to N. The terminalis then connected to the target AP according to the K passwords. Forexample, if K is 3, and the three passwords are abcded, 112239, andxxx123, respectively, abcded can be first used as a password forconnecting to the target AP. If it fails, 112239 can be used as apassword for connecting to the target AP. If it fails, xxx123 can thenbe used as a password for connecting to the target AP.

At block 205, an occurrence frequency of each of the K passwords in thepredetermined list can be determined to obtain K frequencies.

The N target Wi-Fi historical records at most contain N differentpasswords. However, generally, places where the user stays arecentralized, and thus at the same place, the terminal may be connectedto the same AP, and the same password may be used. Thus, the N targetWi-Fi connection records may contain K different passwords, and thenumber of occurrence times of each of the K passwords in the N targetWi-Fi connection records are different. A ratio of the number ofoccurrence times of each of the K passwords in the predetermined list toN can be determined as the occurrence frequency of each of the Kpasswords in the predetermined list. Thus, the frequency of each of theK passwords can be determined.

In an implementation, at block 205, the occurrence frequency of each ofthe K passwords in the predetermined list can be determined as follows.A ratio of the number of occurrence times of each of the K passwords toN is determined as the occurrence frequency of each of the K passwords.For example, if the number of occurrence times of the password i is a,the occurrence frequency of the password i is a/N.

At block 206, a priority sequence of the K passwords are determinedaccording to the K frequencies.

In the implementation of the present disclosure, a principle fordetermining the priority sequence is the following. The higher thefrequency, the higher the priority, or the lower the frequency, thehigher the priority.

At block 207, according to the priority sequence, a password is selectedfrom the K passwords, and the terminal is connected to the target APaccording to the password selected, the SSID, and the encryption schemeof the target AP.

After the priority sequence is determined, the password can be selectedfrom the K passwords according to the priority sequence. For example, ifthere are three passwords, A, B, and C, and the correspondingfrequencies are al, bl, and cl, respectively, where cl is higher thanal, and al is higher than bl. If the principle for determining thepriority sequence is that the higher the frequency, the higher thepriority, the password C can be first selected, and then the terminalattempts to be connected to the target AP according to the password C,the SSID and the encryption scheme of the target AP. If it fails, thepassword A can be selected, and then the terminal attempts to beconnected to the target AP according to the password A, the SSID and theencryption scheme of the target AP, and so on.

It can be seen that, by means of the implementation of the presentdisclosure, the first password input in response to user operation isobtained, where the first password is used for connecting to the targetAP. In response to the unsuccessful verification of the first password,according to the property information of the target AP, the N targetWi-Fi connection records corresponding to the target APs are obtainedfrom the historical Wi-Fi connection data, where the historical Wi-Ficonnection data contains the M Wi-Fi connection records, M is a positiveinteger, and N is a positive integer smaller than or equal to M. The Ntarget Wi-Fi connection records are saved to the predetermined list. Kpasswords corresponding to the N target Wi-Fi connection records areobtained from the predetermined list, where K is an integer smaller thanor equal to N. The occurrence frequency of each of the K passwords inthe predetermined list are determined to obtain K frequencies. Thepriority sequence of the K passwords are determined according to the Kfrequencies. According to the priority sequence, one password isselected from the K passwords, and the terminal is connected to thetarget AP according to the SSID and the encryption scheme of the targetAP. Thus, the terminal can be connected to the target AP by using thepassword in the historical Wi-Fi connection data and corresponding tothe target AP, thereby improving an efficiency of Wi-Fi connection.

In consistence with the above, an apparatus for implementing the abovemethod for Wi-Fi connection is provided, as described in detail below.

Referring to FIG. 3, FIG. 3 is a block diagram illustrating theapparatus for Wi-Fi connection according to an implementation of thepresent disclosure. The apparatus for Wi-Fi connection illustrated inthe implementation includes a first obtaining unit 301, a secondobtaining unit 302, and a connecting unit 303.

The first obtaining unit 301 is configured to obtain a first passwordinput in response to user operation, where the first password is usedfor connecting a terminal to a target AP.

The second obtaining unit 302 is configured to obtain, according toproperty information of the target AP, N target Wi-Fi connection recordscorresponding to the target AP from historical Wi-Fi connection data inresponse to an unsuccessful verification of the first password, wherethe historical Wi-Fi connection data contains M Wi-Fi connectionrecords, M is a positive integer, and N is a positive integer smallerthan or equal to M

The connecting unit 303 is configured to connect the terminal to thetarget AP according to the N target Wi-Fi connection records.

In an implementation, FIG. 4 illustrates a detailed structure of thesecond obtaining unit 302 of the apparatus for Wi-Fi connectionillustrated in FIG. 3. As illustrated in FIG. 4, the second obtainingunit 302 may include a first obtaining module 3021 and a firstdetermining module 3022.

The first obtaining module 3021 is configured to obtain an SSID and anencryption scheme of the target AP.

The first determining module 3022 is configured to determine, accordingto the SSID and the encryption scheme of the target AP, the N targetWi-Fi connection records from the historical Wi-Fi connection data.

In an implementation, FIG. 5 illustrates another detailed structure ofthe second obtaining unit of the apparatus for Wi-Fi connectionillustrated in FIG. 3. As illustrated in FIG. 5, the second obtainingunit 302 may include a second obtaining module 3023 and a seconddetermining module.

The second obtaining module 3023 is configured to obtain a BSSID of thetarget AP.

The second determining module 3024 is configured to determine the Ntarget Wi-Fi connection records from the historical Wi-Fi connectiondata, where each of the N target Wi-Fi connection records contains theBSSID.

In an implementation, the second obtaining unit 302 is configured toobtain an encryption scheme of the target AP, and determine, accordingto the encryption scheme of the target AP, the N target Wi-Fi connectionrecords from the historical Wi-Fi connection data.

In an implementation, the second obtaining unit 302 is configured toobtain an SSID of the target AP, and determine, according to the SSID ofthe target AP, the N target Wi-Fi connection records from the historicalWi-Fi connection data.

In an implementation, FIG. 6 illustrates a detailed structure of theconnecting unit of the apparatus for Wi-Fi connection as illustrated inFIG. 3. As illustrated in FIG. 6, the connecting unit 303 may include asaving module 3031, a third obtaining module 3032, and a firstconnecting module 3033.

The saving module 3031 is configured to save the N target Wi-Ficonnection records to a predetermined list.

The third obtaining module 3032 is configured to obtain, from thepredetermined list, K passwords corresponding to the N target Wi-Ficonnection records, where K is an integer smaller than or equal to N.

The first connecting module 3033 is configured to connect the terminalto the target AP according to the K passwords.

Furthermore, in an implementation, FIG. 7 illustrates a detailedstructure of the first connecting module 3033 of the connecting unit 303as illustrated in FIG. 6. As illustrated in FIG. 7, the first connectingmodule 3033 may include a third determining module 401 and a secondconnecting module 402.

The third determining module 401 is configured to determine anoccurrence frequency of each of the K passwords in the predeterminedlist to obtain K frequencies, and determine a priority sequence of the Kpasswords according to the K frequencies.

The second connecting module 402 is configured to select a password fromthe K passwords according to the priority sequence, and connect theterminal to the target AP according to the password selected, an SSIDand an encryption scheme of the target AP.

In an implementation, the third determining module 401 configured todetermine the occurrence frequency of each of the K passwords in thepredetermined list is configured to determine a ratio of the number ofoccurrence times of each of the K passwords to N as the occurrencefrequency of each of the K passwords.

In an implementation, the first password may be at least one of thefollowing: a character string, fingerprint information, voiceinformation, and iris information.

It can be seen that, by means of the implementation of the presentdisclosure, the first password input in response to user operation isobtained, where the first password is used for connecting to the targetAP. In response to the unsuccessful verification of the first password,according to the property information of the target AP, the N targetWi-Fi connection records corresponding to the target APs are obtainedfrom the historical Wi-Fi connection data, where the historical Wi-Ficonnection data contains M Wi-Fi connection records, M is a positiveinteger, and N is a positive integer smaller than or equal to M. Theterminal is connected to the target AP according to the N target Wi-Ficonnection records. In this case, the terminal can be connected to thetarget AP by using the password in the historical Wi-Fi connection dataand corresponding to the target AP. Thus, an efficiency of Wi-Ficonnection is improved.

It is to be noted that, the apparatus for Wi-Fi connection described inthe apparatus implementation of the disclosure is presented in the formof functional units. The term “unit” used herein should be understood asthe broadest meaning as possible, and an object for implementingfunctions defined by each “unit” may be, for example, an applicationspecific integrated circuit (ASIC), a single circuit, a processor(shared, dedicated, or chipset) and a memory for executing one or moresoftware or firmware programs, a combinational logic circuit, and/orother suitable components that can achieve the above describedfunctions.

For example, the first obtaining unit 301 configured to obtain the firstpassword input in response to user operation and used for connecting tothe target AP may be implemented by a terminal illustrated in FIG. 8. Aprocessor 3000 may obtain the first password input in response to useroperation and used for connecting to the target AP by invokingexecutable program codes stored in a memory 4000.

In consistence with the above, referring to FIG. 8, FIG. 4 is a blockdiagram illustrating the terminal according to an implementation of thepresent disclosure. The terminal described in the implementationincludes at least one input device 1000, at least one output device2000, at least one processor 3000 such as a central processing unit(CPU), and a memory 4000. The input device 1000, the output device 2000,the processor 3000, and the memory 4000 are coupled with each otherthrough a bus 5000.

The input device 1000 may be a touch screen, a physical key, or a mouse.

The output device 2000 may be a display screen.

The memory 4000 may be a random access memory (RAM), and may be anon-volatile memory, such as a disk storage. The memory 4000 isconfigured to store a set of program codes, and the input device 1000,the output device 2000, and the processor 3000 are configured to invokethe program codes stored in the memory 4000 to perform the following.

The processor 3000 is configured to obtain a first password input inresponse to user operation and used for connecting the terminal to atarget AP, and obtain, according to property information of the targetAP, N target Wi-Fi connection records corresponding to the target APfrom historical Wi-Fi connection data in response to an unsuccessfulverification of the first password, where the historical Wi-Ficonnection data contains M Wi-Fi connection records, M is a positiveinteger, and N is a positive integer smaller than or equal to M. Theprocessor 3000 is further configured to connect the terminal to thetarget AP according to the N target Wi-Fi connection records.

In an implementation, the processor 3000 configured to obtain, accordingto the property information of the target AP, the N target Wi-Ficonnection records corresponding to the target AP from the historicalWi-Fi connection data is configured to obtain an SSID and an encryptionscheme of the target AP, and determine, according to the SSID and theencryption scheme of the target AP, the N target Wi-Fi connectionrecords from the historical Wi-Fi connection data.

In an implementation, the processor 3000 configured to obtain, accordingto the property information of the target AP, the N target Wi-Ficonnection records corresponding to the target AP from the historicalWi-Fi connection data is configured to obtain a basic service setidentifier (BSSID) of the target AP, and determine the N target Wi-Ficonnection records from the historical Wi-Fi connection data, where eachof the N target Wi-Fi connection records contains the BSSID.

In an implementation, the processor 3000 configured to obtain, accordingto the property information of the target AP, the N target Wi-Ficonnection records corresponding to the target AP from the historicalWi-Fi connection data is configured to obtain an encryption scheme ofthe target AP, and determine, according to the encryption scheme of thetarget AP, the N target Wi-Fi connection records from the historicalWi-Fi connection data.

In an implementation, the processor 3000 configured to obtain, accordingto the property information of the target AP, the N target Wi-Ficonnection records corresponding to the target AP from the historicalWi-Fi connection data is configured to obtain an SSID of the target AP,and determine, according to the SSID of the target AP, the N targetWi-Fi connection records from the historical Wi-Fi connection data.

In an implementation, the processor 3000 configured to connect theterminal to the target AP according to the N target Wi-Fi connectionrecords is configured to save the N target Wi-Fi connection records to apredetermined list, and obtain, from the predetermined list, K passwordscorresponding to the N target Wi-Fi connection records, and connect theterminal to the target AP according to the K passwords, where K is aninteger smaller than or equal to N.

In an implementation, the processor 3000 configured to connect theterminal to the target AP according to the K passwords is configured todetermine an occurrence frequency of each of the K passwords in thepredetermined list to obtain K frequencies, determine a prioritysequence of the K passwords according to the K frequencies, select,according to the priority sequence, a password from the K passwords, andconnect the terminal to the target AP according to the passwordselected, an SSID and an encryption scheme of the target AP.

In an implementation, the processor 3000 configured to determine theoccurrence frequency of each of the K passwords in the predeterminedlist is configured to determine a ratio of the number of occurrencetimes of each of the K passwords to N as the occurrence frequency ofeach of the K passwords.

In an implementation, the first password may be at least one of thefollowing: a character string, fingerprint information, voiceinformation, and iris information.

The implementations of the present disclosure also provide a computerstorage medium. The computer readable storage medium is configured tostore computer programs, where the computer programs are operable toexecute some of or all operations of the method for Wi-Fi connectiondescribed in any one of method implementations of the presentdisclosure.

The implementations of the present disclosure also provide a computerprogram product. The computer program product includes a non-transitorycomputer-readable storage medium that stores computer programs, wherethe computer programs are operable with a computer to execute some of orall operations of the method for Wi-Fi connection described in any oneof method implementations of the present disclosure.

Although the present disclosure has been described in conjunction withvarious implementations herein, however, other variations to theenclosed implementations can be understood and effected by those skilledin the art from a study of the drawings, the disclosure, and theappended claims. In the claims, the word “comprising” does not excludeother elements or steps, and the indefinite article “a” or “an” does notexclude a plurality. The mere fact that certain measures are recited inmutually different dependent claims does not indicate that a combinationof these measures cannot be used to advantage.

Those skilled in the art should understand that the implementation ofthe disclosure may be provided as a method, an apparatus (equipment), ora computer program product. Therefore, the present disclosure may use aform of hardware only implementations, software only implementations, orimplementations with a combination of software and hardware. Moreover,the present disclosure may use a form of a computer program product thatis implemented on one or more computer-usable storage media (includingbut not limited to a disk memory, a CD-ROM, an optical memory, and thelike) that include computer-usable program codes. The computer programis stored/distributed in a proper medium and is provided as or used as apart of the hardware together with another hardware, or may also useanother allocation form, such as by using the Internet or another wiredor wireless telecommunications system.

The present disclosure is described in connection with flowcharts and/orblock diagrams of the method, apparatus (equipment), and computerprogram products according to the implementations of the disclosure. Itshould be understood that each flow and/or block in the flowchartsand/or the block diagrams and combinations of the flows and/or blocks inthe flowcharts and/or the block diagrams may be implemented by computerprogram instructions. These computer program instructions may beprovided for a universal computer, a dedicated computer, an embeddedprocessor, or a processor of other programmable data processingequipment to generate a machine, so that an apparatus for realizing afunction specified in one flow or more flows in the flowcharts and/orone block or more blocks in the block diagrams is generated by theinstructions executed through the computer or the processor of the otherprogrammable data processing device.

These computer program instructions may also be stored in acomputer-readable memory capable of guiding the computer or the otherprogrammable data processing device to work in a specific manner, sothat a product including an instruction device may be generated by theinstructions stored in the computer-readable memory, the instructiondevice realizing the function specified in one flow or many flows in theflowcharts and/or one block or many blocks in the block diagrams.

These computer program instructions may further be loaded onto thecomputer or the other programmable data processing device, so that aseries of operations are executed on the computer or the otherprogrammable data processing device to generate processing implementedby the computer, and operations for realizing the function specified inone flow or many flows in the flowcharts and/or one block or many blocksin the block diagrams are provided by the instructions executed on thecomputer or the other programmable data processing device.

Although the present disclosure is described in connection with specificcharacteristics and the implementations, obviously, variousmodifications and combinations may be made to the disclosure withoutdeparting from the spirit and scope of the disclosure. Correspondingly,the specification and the drawings are only exemplary descriptions aboutthe disclosure defined by the appended claims, and are considered tocover any and all modifications, variations, combinations or equivalentsin the scope of the disclosure. Obviously, those skilled in the art maymake various modifications and variations to the disclosure withoutdeparting from the spirit and scope of the disclosure. Therefore, ifthese modifications and variations of the disclosure belong to the scopeof the claims of the disclosure and equivalent technologies thereof, thedisclosure is also intended to include these modifications andvariations.

What is claimed is:
 1. A method for wireless fidelity (Wi-Fi)connection, comprising: obtaining an input password used for connectinga terminal to a target access point (AP); obtaining, according toproperty information of the target AP, N target Wi-Fi connection recordscorresponding to the target AP from historical Wi-Fi connection data inresponse to an unsuccessful verification of the input password, thehistorical Wi-Fi connection data containing M Wi-Fi connection records,M being a positive integer, and N being a positive integer smaller thanor equal to M; saving the N target Wi-Fi connection records to apredetermined list; obtaining, from the predetermined list, K passwordscorresponding to the N target Wi-Fi connection records, K being aninteger less than or equal to N; and connecting the terminal to thetarget AP according to the K passwords.
 2. The method of claim 1,wherein obtaining, according to the property information of the targetAP, the N target Wi-Fi connection records corresponding to the target APfrom the historical Wi-Fi connection data comprises: obtaining a serviceset identifier (SSID) and an encryption scheme of the target AP; anddetermining, according to the SSID and the encryption scheme of thetarget AP, the N target Wi-Fi connection records from the historicalWi-Fi connection data.
 3. The method of claim 1, wherein obtaining,according to the property information of the target AP, the N targetWi-Fi connection records corresponding to the target AP from thehistorical Wi-Fi connection data comprises: obtaining a basic serviceset identifier (BSSID) of the target AP; and determining the N targetWi-Fi connection records from the historical Wi-Fi connection data, eachof the N target Wi-Fi connection records containing the BSSID.
 4. Themethod of claim 1, wherein obtaining, according to the propertyinformation of the target AP, the N target Wi-Fi connection recordscorresponding to the target AP from the historical Wi-Fi connection datacomprises: obtaining an encryption scheme of the target AP; anddetermining, according to the encryption scheme of the target AP, the Ntarget Wi-Fi connection records from the historical Wi-Fi connectiondata.
 5. The method of claim 1, wherein obtaining, according to theproperty information of the target AP, the N target Wi-Fi connectionrecords corresponding to the target AP from the historical Wi-Ficonnection data comprises: obtaining an SSID of the target AP; anddetermining, according to the SSID of the target AP, the N target Wi-Ficonnection records from the historical Wi-Fi connection data.
 6. Themethod of claim 1, wherein connecting the terminal to the target APaccording to the K passwords comprises: determining an occurrencefrequency of each of the K passwords in the predetermined list to obtainK frequencies; determining a priority sequence of the K passwordsaccording to the K frequencies; selecting, according to the prioritysequence, a password from the K passwords; and connecting the terminalto the target AP according to the password selected, an SSID and anencryption scheme of the target AP.
 7. The method of claim 6, furthercomprising: determining a ratio of the number of occurrence times ofeach of the K passwords in the predetermined list to N as the occurrencefrequency of each of the K passwords in the predetermined list.
 8. Themethod of claim 1, wherein the input password comprises at least one of:a character string, fingerprint information, voice information, and irisinformation.
 9. A terminal comprising: at least one processor; and acomputer readable memory, coupled to the at least one processor andstoring at least one computer executable instruction therein, which whenexecuted by the at least one processor, causes the at least oneprocessor to carry out actions, comprising: obtaining an input passwordused for connecting the terminal to a target access point (AP);obtaining, according to property information of the target AP, N targetWi-Fi connection records corresponding to the target AP from historicalWi-Fi connection data in response to an unsuccessful verification of theinput password, the historical Wi-Fi connection data containing M Wi-Ficonnection records, M being a positive integer, and N being a positiveinteger smaller than or equal to M; saving the N target Wi-Fi connectionrecords to a predetermined list; obtaining, from the predetermined list,K passwords corresponding to the N target Wi-Fi connection records, Kbeing an integer less than or equal to N; and connecting the terminal tothe target AP according to the K passwords.
 10. The terminal of claim 9,wherein the at least one processor carrying out the action of obtaining,according to the property information of the target AP, the N targetWi-Fi connection records corresponding to the target AP from thehistorical Wi-Fi connection data is caused to carry out actions,comprising: obtaining a service set identifier (SSID) and an encryptionscheme of the target AP; and determining, according to the SSID and theencryption scheme of the target AP, the N target Wi-Fi connectionrecords from the historical Wi-Fi connection data.
 11. The terminal ofclaim 9, wherein the at least one processor carrying out the action ofobtaining, according to the property information of the target AP, the Ntarget Wi-Fi connection records corresponding to the target AP from thehistorical Wi-Fi connection data is caused to carry out actions,comprising: obtaining a basic service set identifier (BSSID) of thetarget AP; and determining the N target Wi-Fi connection records fromthe historical Wi-Fi connection data, each of the N target Wi-Ficonnection records containing the BSSID.
 12. The terminal of claim 9,wherein the at least one processor carrying out the action of obtaining,according to the property information of the target AP, the N targetWi-Fi connection records corresponding to the target AP from thehistorical Wi-Fi connection data is caused to carry out actions,comprising: obtaining an encryption scheme of the target AP; anddetermining, according to the encryption scheme of the target AP, the Ntarget Wi-Fi connection records from the historical Wi-Fi connectiondata.
 13. The terminal of claim 9, wherein the at least one processorcarrying out the action of obtaining, according to the propertyinformation of the target AP, the N target Wi-Fi connection recordscorresponding to the target AP from the historical Wi-Fi connection datais caused to carry out actions, comprising: obtaining an SSID of thetarget AP; and determining, according to the SSID of the target AP, theN target Wi-Fi connection records from the historical Wi-Fi connectiondata.
 14. The terminal of claim 9, wherein the at least one processorcarrying out the action of connecting the terminal to the target APaccording to the K passwords is caused to carry out actions, comprising:determining an occurrence frequency of each of the K passwords in thepredetermined list to obtain K frequencies; determining a prioritysequence of the K passwords according to the K frequencies; selecting,according to the priority sequence, a password from the K passwords; andconnecting the terminal to the target AP according to the passwordselected, an SSID and an encryption scheme of the target AP.
 15. Theterminal of claim 14, wherein the at least one computer executableinstruction further causes the at least one processor to carry outactions, comprising: determining a ratio of the number of occurrencetimes of each of the K passwords in the predetermined list to N as theoccurrence frequency of each of the K passwords in the predeterminedlist.
 16. The terminal of claim 9, wherein the input password comprisesat least one of: a character string, fingerprint information, voiceinformation, and iris information.
 17. A terminal comprising: at leastone processor; and a computer readable memory, coupled to the at leastone processor and storing at least one computer executable instructiontherein, which when executed by the at least one processor, causes theat least one processor to carry out actions, comprising: determining, inresponse to an unsuccessful connection to an AP according to an inputpassword, plurality of passwords from historical Wi-Fi connection datapre-stored in the terminal, wherein each of the plurality of passwordswas previously used for connecting the terminal to the AP; andconnecting the terminal to the AP according to the plurality ofpasswords.
 18. The terminal of claim 17, wherein the at least onepassword is embodied as a plurality passwords; and the at least oneprocessor carrying out the action of connecting the terminal to the APaccording to the at least one password is caused to carry out actions,comprising: determining a priority sequence of the plurality ofpasswords; and selecting the plurality of passwords sequentiallyaccording to the priority sequence to connect the terminal to the AP.